package com.sl.au.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.sl.au.entity.AccountsReceivablePlan;

public interface AccountsReceivablePlanRepository extends JpaRepository<AccountsReceivablePlan, String> {

	@Query("select p from AccountsReceivablePlan p where p.sContractId = ?1 and p.sContractType = ?2 order by p.sAccountsReceivableTypeId.nAccountsReceivableTypeOrder asc")
	List<AccountsReceivablePlan> findBySContractIdAndSContractType(String sContractId, String sContractType);

	@Query(" select a from AccountsReceivablePlan a where a.id in (?1) ")
	List<AccountsReceivablePlan> findByIds(String planIds);
	
	@Query("select p.nTotalPrice from AccountsReceivablePlan p where p.sContractId = ?1 and p.sContractType = ?2")
    float[] getnTotalPrice(String contractId,String contractType);
	
}
